package com.demo.service.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.demo.dao.CommonDAO;
import com.demo.dto.UserDetailsDTO;
import com.demo.form.UserForm;

@Service
public class CommonService {

	@Autowired
	CommonDAO commonDAO;
	
	
	public void registerUser(UserForm userForm){
		
		 UserDetailsDTO userDetailsDTO=new UserDetailsDTO();
		 
		 userDetailsDTO.setUserName(userForm.getUserName());
		 userDetailsDTO.setPassword(userForm.getPassword());
		 userDetailsDTO.setAge(userForm.getAge());
		 
		 commonDAO.insertRow(userDetailsDTO);
		 System.out.println("row inserted successfully..");
		
		
		
	}
	
	
	
	  
	
	
}
